//package com.rui.study.micro.usermanager.config.filter;
//
//import org.apache.shiro.web.filter.AccessControlFilter;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import javax.servlet.ServletRequest;
//import javax.servlet.ServletResponse;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//
//public class ReSubmitFilter extends AccessControlFilter {
//
//    private static final Logger LOGGER = LoggerFactory.getLogger(ReSubmitFilter.class);
//
//    @Override
//    protected boolean isAccessAllowed(ServletRequest request, ServletResponse response,
//                                      Object mappedValue) {
//        HttpServletRequest req = (HttpServletRequest) request;
//        HttpServletResponse res = (HttpServletResponse) response;
//        HttpSession session = req.getSession();
//
//        String submitToken = req.getHeader("Submit-Token");
//        String submitTokenInSession = (String) session.getAttribute("submitToken");
//
//        return true;
//
////        if (submitToken != null && submitToken.equals(submitTokenInSession)) {
////            return true;
////        }
////
////        LOGGER.error("Request is denied, because 'submitToken' [{}] is invalid", submitToken);
////        WebUtil.response(res, StatusCode.ACCESS_DENIED);
////        return false;
//    }
//
//    @Override
//    protected boolean onAccessDenied(ServletRequest request, ServletResponse response) {
//        return false;
//    }
//}
